{include file="common/head"/}
<div class="layui-fluid"><div class="layui-card"><div class="layui-card-body">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>短信接口配置</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">App ID</label>
                <div class="layui-input-inline">
                <input type="text" lay-verify="required" name="dy_sms_appid" placeholder="App ID" value="{$info.dy_sms_appid}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">App Secret</label>
                <div class="layui-input-inline">
                <input type="text" lay-verify="required" name="dy_sms_appSecret" placeholder="App Secret" value="{$info.dy_sms_appSecret}" class="layui-input">
            </div>
        </div>
       
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
                <button type="reset" class="layui-btn layui-btn-primary">{:lang('reset')}</button>
            </div>
        </div>
    </form>
</div> 
</div> 
</div> 
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$= layui.jquery;
        //提交监听
        form.on('submit(submit)', function (data) {
            loading =layer.load(1, {shade: [0.1,'#fff']});
            $.post("{:url('system/sms')}",data.field,function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{icon: 1, time: 1000},function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg,{icon: 2, time: 1000});
                }
            });
        })
    })
</script>
</body>
</html>